<%@ page import="com.itheima.bean.Student" %>
<%@ page import="java.util.Map" %>
<%@ page import="java.util.HashMap" %><%--
  Created by IntelliJ IDEA.
  User: 98103
  Date: 2020/7/21
  Time: 19:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>EL练习</title>
</head>
<body>
<% pageContext.setAttribute("username", "张晨"); %>
EL表达式获取String类型：${username}<br/>
<%
    pageContext.setAttribute("student", new Student("苏政", 25, 100));
%>
EL表达式获取自定义对象类型：${student}<br/>
${student.username}<br/>
${student.age}<br/>
${student.score}<br/>

<%
    Map<String, Student> map = new HashMap<>();
    map.put("aaa", new Student("刘道兵",25,99));
    pageContext.setAttribute("map",map);
%>
EL表达式获取Map类型：${map}<br/>
${map}
${map.aaa}<br/>
${map.aaa.username}<br/>
${map.aaa.age}<br/>
${map.aaa.score}<br/>
</body>
</html>
